package com.azzcs.elasticsearch.utils;

import java.sql.Connection;
import java.sql.DriverManager;

/**
 * @Author: wzg
 * @Date: 2021/5/14 上午7:43
 */
public class DBHelper {
    private static final String url = "jdbc:mysql://127.0.0.1:3306/lagou_position?" +
            "useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai";
    private static final String driverName ="com.mysql.cj.jdbc.Driver";
    private static final String user ="root";
    private static final String password ="azzcs";

    private static Connection connection = null;

    public static Connection getConnection(){
        try{
            Class.forName(driverName);
            connection = DriverManager.getConnection(url,user,password);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return connection;
    }
}
